package com.pmcc.cj.entity;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.pmcc.core.entity.UUIDEntity;
import com.pmcc.utils.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.math.BigDecimal;
import java.util.Date;

/**
 * Created by tomas on 2020/10/10.
 */
@Entity
@Table(name = "cj_money_record")
public class CjMoneyRecord extends UUIDEntity {
    @Column(name = "money")
    private BigDecimal money;//变动金额
    @Column(name = "order_id")
    private String orderId;//订单表
    @Column(name = "customer_income_id")
    private String customerIncomeId;//收钱人
    @Column(name = "customer_pay_id")
    private String customerPayId;//出钱人
    @Column(name = "create_date")
    private Date createDate;
    @Column(name = "fettle")
    private Integer fettle;//0：支出   1：收入    2：退款    3：提现
    @Column(name = "customer_belong_id")
    private String customerBelongId;//归属人id
    @Column(name = "name")
    private String name;//归属人

    @Transient
    private String incomeName;
    @Transient
    private String payName;

    public String getIncomeName() {
        return incomeName;
    }

    public void setIncomeName(String incomeName) {
        this.incomeName = incomeName;
    }

    public String getPayName() {
        return payName;
    }

    public void setPayName(String payName) {
        this.payName = payName;
    }

    public BigDecimal getMoney() {
        return money;
    }

    public void setMoney(BigDecimal money) {
        this.money = money;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    @JsonSerialize(using = DateTimeFormat.class)
    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Integer getFettle() {
        return fettle;
    }

    public void setFettle(Integer fettle) {
        this.fettle = fettle;
    }

    public String getCustomerBelongId() {
        return customerBelongId;
    }

    public void setCustomerBelongId(String customerBelongId) {
        this.customerBelongId = customerBelongId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCustomerIncomeId() {
        return customerIncomeId;
    }

    public void setCustomerIncomeId(String customerIncomeId) {
        this.customerIncomeId = customerIncomeId;
    }

    public String getCustomerPayId() {
        return customerPayId;
    }

    public void setCustomerPayId(String customerPayId) {
        this.customerPayId = customerPayId;
    }
}
